package com.ds.client;

import com.ds.client.exception.ProfileNotFoundException;
import java.util.Scanner;
import com.ds.util.PomProfileComparator;

/**
 * Command Line Client for the PomProfileComparator class
 * @author exploredhiraj
 */
public class ConsoleComparator {

    public static void main(String args[]) {
        try {
            Scanner sc = new Scanner(System.in);
            System.out.print("Enter the path of the POM file: ");
            String inputPomFileName = sc.next();
            System.out.print("Enter the path of the output HTML file(extension not required): ");
            String outputHtmlFileName = sc.next();
            System.out.print("Enter the profile names to be compared (Comma separated): ");
            String profileNames = sc.next();
            if (profileNames == null || profileNames.equals("")) {
                System.out.print("No profiles provided");
                throw new Exception();
            }
            PomProfileComparator pomProfileComparator = new PomProfileComparator();
            pomProfileComparator.compareProfiles(inputPomFileName, outputHtmlFileName, profileNames);
        } catch (ProfileNotFoundException e) {
            System.out.print("Exception :" + e);
            System.exit(1);
        } catch (Exception e) {
            System.out.print("Exception occured .. " + e);
            System.exit(1);
        }
    }
}
